package com.ruoyi.personnel.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.personnel.domain.EducationInfo;
import com.ruoyi.personnel.mapper.EducationInfoMapper;
import com.ruoyi.personnel.service.IEducationInfoService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 学历信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-02-24
 */
@Service
public class EducationInfoServiceImpl extends ServiceImpl<EducationInfoMapper, EducationInfo> implements IEducationInfoService {

    @Override
    public List<EducationInfo> queryList(EducationInfo educationInfo) {
        LambdaQueryWrapper<EducationInfo> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(educationInfo.getName())){
            lqw.like(EducationInfo::getName ,educationInfo.getName());
        }
        if (StringUtils.isNotBlank(educationInfo.getJobNumber())){
            lqw.eq(EducationInfo::getJobNumber ,educationInfo.getJobNumber());
        }
        if (StringUtils.isNotBlank(educationInfo.getEducation())){
            lqw.eq(EducationInfo::getEducation ,educationInfo.getEducation());
        }
        if (StringUtils.isNotBlank(educationInfo.getEducationTime())){
            lqw.eq(EducationInfo::getEducationTime ,educationInfo.getEducationTime());
        }
        if (StringUtils.isNotBlank(educationInfo.getDegree())){
            lqw.eq(EducationInfo::getDegree ,educationInfo.getDegree());
        }
        if (StringUtils.isNotBlank(educationInfo.getDegreeTime())){
            lqw.eq(EducationInfo::getDegreeTime ,educationInfo.getDegreeTime());
        }
        if (StringUtils.isNotBlank(educationInfo.getSchoolsUnits())){
            lqw.eq(EducationInfo::getSchoolsUnits ,educationInfo.getSchoolsUnits());
        }
        if (StringUtils.isNotBlank(educationInfo.getMajor())){
            lqw.eq(EducationInfo::getMajor ,educationInfo.getMajor());
        }
        if (StringUtils.isNotBlank(educationInfo.getAdmissionTime())){
            lqw.eq(EducationInfo::getAdmissionTime ,educationInfo.getAdmissionTime());
        }
        if (StringUtils.isNotBlank(educationInfo.getLearningForm())){
            lqw.eq(EducationInfo::getLearningForm ,educationInfo.getLearningForm());
        }
        if (StringUtils.isNotBlank(educationInfo.getTeacher())){
            lqw.eq(EducationInfo::getTeacher ,educationInfo.getTeacher());
        }
        if (StringUtils.isNotBlank(educationInfo.getMajorDescribe())){
            lqw.eq(EducationInfo::getMajorDescribe ,educationInfo.getMajorDescribe());
        }
        if (StringUtils.isNotBlank(educationInfo.getIsHighesteducation())){
            lqw.eq(EducationInfo::getIsHighesteducation ,educationInfo.getIsHighesteducation());
        }
        if (StringUtils.isNotBlank(educationInfo.getIsHighestdegree())){
            lqw.eq(EducationInfo::getIsHighestdegree ,educationInfo.getIsHighestdegree());
        }
        if (StringUtils.isNotBlank(educationInfo.getPersonnelId())){
            lqw.eq(EducationInfo::getPersonnelId ,educationInfo.getPersonnelId());
        }
        if (StringUtils.isNotBlank(educationInfo.getStatus())){
            lqw.eq(EducationInfo::getStatus ,educationInfo.getStatus());
        }
        return this.list(lqw);
    }
}
